import request from '@/utils/request'
let baseUrl = process.env.NODE_ENV === 'production' ? 'api/core' : '/core'

export const getFlowList = (data: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/flow/query',
    method: 'post',
    data
  })

export const getFlow = (data: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/flow/' + data,
    method: 'get'
  })

export const addFlow = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/flow/add',
    method: 'post',
    data
  })

export const updateFlow = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/flow/update',
    method: 'post',
    data
  })

export const getFlowTemplateList = (data: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/flow/template/query',
    method: 'post',
    data
  })

export const getFlowTemplate = (data: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/flow/template/' + data,
    method: 'get'
  })

export const addFlowTemplate = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/flow/template/add',
    method: 'post',
    data
  })

export const updateFlowTemplate = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/contract/flow/template/update',
    method: 'post',
    data
  })
